// DLLTest.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
//#include ".\src\f2c.h"
#include ".\src\dgtsv.h"


BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}


char szReturn[MAX_PATH];

__declspec(dllexport) LPCTSTR RetrieveTempFilename(LPCTSTR szDirectory, LPCTSTR szPrefix)
{
	char szBuffer[MAX_PATH];
	if(GetTempFileName(szDirectory,szPrefix,0,szBuffer) == 0)
	{
		// It failed - return the string "ERROR"
		lstrcpy(szReturn,"ERROR");
	} else {
		// Success!
		lstrcpy(szReturn,szBuffer);
	}
	return szReturn;
}

__declspec(dllexport) int getResult(int x, int y)
{
	return x + y;
}


__declspec(dllexport) long Computer_dgtsv(long N, long NRHS, double *DL, double *D, double *DU, double *B,long LDB)
{
	long info;  
	dgtsv_(&N, &NRHS, DL, D, DU, B, &LDB, &info);	
	return info;
}